Skip to content

Comments

feat: add ais.clearRefinements widget with list field type#32

Merged
sarahdayan merged 6 commits intomainfrom
feat/clear-refinements-widget
Feb 24, 2026
Merged

feat: add ais.clearRefinements widget with list field type#32
sarahdayan merged 6 commits intomainfrom
feat/clear-refinements-widget

Conversation

@sarahdayan
Copy link
Member

@sarahdayan sarahdayan commented Feb 22, 2026

Summary

  • Adds a new list field type to the toolbar's FieldOverride union for string array parameters, with a toggleable switch (OFF = undefined / use library defaults, ON = editable list with add/remove/edit per item)
  • Enables the ais.clearRefinements widget with includedAttributes, excludedAttributes, and cssClasses fields
  • Registers ais.clearRefinements in the runtime with passthrough transformParams
  • includedAttributes and excludedAttributes are mutually exclusive: toggling one on automatically clears the other (via the new excludes property on field overrides)
  • List field values are sanitized on save: items are trimmed and empty strings are removed. If all items are empty, the parameter is set to undefined
Capture d'écran 2026-02-22 à 15 12 14

@netlify
Copy link

netlify bot commented Feb 22, 2026

Deploy Preview for algolia-experiences-js ready!

Name Link
🔨 Latest commit fa63ee7
🔍 Latest deploy log https://app.netlify.com/projects/algolia-experiences-js/deploys/699d65efd1b684000768395d
😎 Deploy Preview https://deploy-preview-32--algolia-experiences-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 22, 2026

Deploy Preview for algolia-experiences-react ready!

Name Link
🔨 Latest commit fa63ee7
🔍 Latest deploy log https://app.netlify.com/projects/algolia-experiences-react/deploys/699d65ef0611a200089ec6eb
😎 Deploy Preview https://deploy-preview-32--algolia-experiences-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sarahdayan sarahdayan changed the title feat: add ais.clearRefinements widget with list field type feat: add ais.clearRefinements widget with list field type Feb 22, 2026
@sarahdayan sarahdayan requested a review from dhayab February 23, 2026 10:16
@sarahdayan sarahdayan force-pushed the feat/clear-refinements-widget branch from 913088f to 9622303 Compare February 23, 2026 16:20
@sarahdayan sarahdayan changed the base branch from main to feat/items-list-field February 23, 2026 16:20
Comment on lines +253 to +267
const X_ICON = (
<svg
class="size-4 shrink-0"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should this be somewhere else, in components or assets?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will use Lucide Icons to replace them all cleanly.

@sarahdayan sarahdayan force-pushed the feat/items-list-field branch from a64539b to c547b8f Compare February 24, 2026 08:41
@sarahdayan sarahdayan force-pushed the feat/clear-refinements-widget branch from 9622303 to ec8acba Compare February 24, 2026 08:41
Base automatically changed from feat/items-list-field to main February 24, 2026 08:43
sarahdayan and others added 6 commits February 24, 2026 09:48
Add a new `list` field type for string array parameters (toggleable,
with add/remove/edit per item) and use it to enable the
ais.clearRefinements widget with includedAttributes and
excludedAttributes support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…other on

Add `excludes` property to field overrides so toggling on `includedAttributes`
clears `excludedAttributes` and vice versa.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Trim whitespace and remove empty items from list parameters before
sending to the API. If all items are empty, the parameter is set to
undefined.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sarahdayan sarahdayan force-pushed the feat/clear-refinements-widget branch from ec8acba to fa63ee7 Compare February 24, 2026 08:48
@sarahdayan sarahdayan merged commit 172740d into main Feb 24, 2026
8 checks passed
@sarahdayan sarahdayan deleted the feat/clear-refinements-widget branch February 24, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants